package com.lvmama.pangolin.controller;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lvmama.pangolin.entity.City_Model;
import com.lvmama.pangolin.entity.InputProduct;
import com.lvmama.pangolin.entity.LMMCareProductVO;
import com.lvmama.pangolin.entity.hotel.HotelProductDetail;
import com.lvmama.pangolin.entity.lmm.LMMCareProduct;
import com.lvmama.pangolin.entity.mt.MTTicketProduct;
import com.lvmama.pangolin.entity.qnr.QNRTicketProduct;
import com.lvmama.pangolin.entity.tc.TCTicketProduct;
import com.lvmama.pangolin.entity.tn.TNTicketProduct;
import com.lvmama.pangolin.entity.xc.XCTicketProduct;
import com.lvmama.pangolin.hotel.service.HotelProductDetailService;
import com.lvmama.pangolin.lmm.service.LMMCareProductService;
import com.lvmama.pangolin.mt.service.MTTicketProductService;
import com.lvmama.pangolin.qnr.service.QNRTicketProductService;
import com.lvmama.pangolin.service.CityService;
import com.lvmama.pangolin.tc.service.TCTicketProductService;
import com.lvmama.pangolin.tn.service.TNTicketProductService;
import com.lvmama.pangolin.xc.service.XCTicketProductService;

@Controller
@RequestMapping("/datashow")
public class InputProductController {

	@Autowired
	LMMCareProductService productService;
	@Autowired
	XCTicketProductService xcProductService;
	@Autowired
	TNTicketProductService tnProductService;
	@Autowired
	TCTicketProductService tcProductService;
	@Autowired
	QNRTicketProductService qnrProductService;
	@Autowired
	MTTicketProductService mtProductService;
	@Autowired
	private CityService cityService;
	@Autowired
	private HotelProductDetailService hotelProductService;

	@RequestMapping("/inputProduct")
	public String showList(ModelMap model, LMMCareProductVO pc, String companyCode) {
//		LMMCareProductVO pc2=pc;
//		pc2.setProductId(null);
//		pc2.setProductName(null);
		if(companyCode==null||"".equals(companyCode)){
			companyCode="xc";
			pc.setCompanyCode(companyCode);
		}
		List<LMMCareProduct> careProducts = productService.getAllCare(pc);
		List<City_Model> citys=cityService.getAllCity();
		List<InputProduct> inputProds = new ArrayList<InputProduct>();
		String businessCode=pc.getBusinessCode();
		if(businessCode==null||"".equals(businessCode)||"TICKET".equals(businessCode)){
			if (companyCode == null || "xc".equals(companyCode)) {
				for (LMMCareProduct cp:careProducts) {
					if (cp.getXc_url() != null && !"".equals(cp.getXc_url()) && !"".equals(cp.getXc_url().trim())) {
						String url = cp.getXc_url().split("\n")[0];
						String[] s=url.split("/");
						String url2="http://piao.ctrip.com/Thingstodo-Booking-ShoppingWebSite/dest/"+s[s.length-1];
						List<XCTicketProduct> xcProducts = xcProductService.selectByUrl(url,url2);
						if(xcProducts==null||xcProducts.size()==0){
							xcProducts=xcProductService.selectByName(cp.getXc_name());
						}
						InputProduct inputProd = new InputProduct();
						inputProd.setDetailUrl(url);
						if (xcProducts.size() > 0) {
							inputProd.setSceneryName(xcProducts.get(0).getSceneryName());
							inputProd.setId(xcProducts.get(0).getId());
							inputProd.setProductId(xcProducts.get(0).getProductId());
							inputProd.setSceneryAddr(xcProducts.get(0).getSceneryAddr());
							inputProd.setCompanyCode("xc");
							inputProd.setCityCode(xcProducts.get(0).getCityCode());
							for(City_Model city:citys){
								if(city.getCityId().equals(xcProducts.get(0).getCityCode())){
									inputProd.setCityName(city.getName());
								}
							}
							inputProd.setCreateTime(xcProducts.get(0).getCreateTime());
							inputProd.setLowestPrice(xcProducts.get(0).getLowestPrice());
							inputProd.setScore(xcProducts.get(0).getScore());
							inputProd.setSnapshotAddr(xcProducts.get(0).getSnapshotAddr());
							inputProd.setStarLevel(xcProducts.get(0).getStarLevel());
							inputProd.setTaskId(xcProducts.get(0).getTaskId());
						}
						inputProds.add(inputProd);
//						if(pc.getProductId()!=null&&pc.getProductName()!=null){
//							if(inputProd.getProductId()!=null&&!"".equals(inputProd.getProductId().trim())&&
//									inputProd.getProductId().contains(pc.getProductId())&&
//									inputProd.getSceneryName()!=null&&!"".equals(inputProd.getSceneryName().trim())&&
//									inputProd.getSceneryName().contains(pc.getProductName())){
//								inputProds.add(inputProd);
//							}
//							
//						}else{
//							inputProds.add(inputProd);
//						}
					}
				}
				
			} else if ("tn".equals(companyCode)) {
				for (LMMCareProduct cp:careProducts) {
					if (cp.getTn_url() != null && !"".equals(cp.getTn_url()) && !"".equals(cp.getTn_url().trim())) {
						InputProduct inputProd = new InputProduct();
						String url = cp.getTn_url().split("\n")[0];
						List<TNTicketProduct> tnProducts = tnProductService.selectByUrl(url);
						inputProd.setDetailUrl(url);
						if(tnProducts==null||tnProducts.size()==0){
							tnProducts=tnProductService.selectByName(cp.getTn_name());
						}
						if (tnProducts.size() > 0) {
							inputProd.setSceneryName(tnProducts.get(0).getSceneryName());
							inputProd.setId(tnProducts.get(0).getId());
							inputProd.setProductId(tnProducts.get(0).getProductId());
							inputProd.setSceneryAddr(tnProducts.get(0).getSceneryAddr());
							inputProd.setCompanyCode("tn");
							inputProd.setCityCode(tnProducts.get(0).getCityCode());
							for(City_Model city:citys){
								if(city.getCityId().equals(tnProducts.get(0).getCityCode())){
									inputProd.setCityName(city.getName());
								}
							}
							inputProd.setCreateTime(tnProducts.get(0).getCreateTime());
							inputProd.setLowestPrice(tnProducts.get(0).getLowestPrice());
							inputProd.setScore(tnProducts.get(0).getScore());
							inputProd.setSnapshotAddr(tnProducts.get(0).getSnapshotAddr());
							inputProd.setStarLevel(tnProducts.get(0).getStarLevel());
							inputProd.setTaskId(tnProducts.get(0).getTaskId());
							inputProd.setSaleCount(tnProducts.get(0).getSaleCount());

						}
						inputProds.add(inputProd);
//						if(pc.getProductId()!=null&&pc.getProductName()!=null){
//							if(inputProd.getProductId()!=null&&!"".equals(inputProd.getProductId().trim())&&
//									inputProd.getProductId().contains(pc.getProductId())&&
//									inputProd.getSceneryName()!=null&&!"".equals(inputProd.getSceneryName().trim())&&
//									inputProd.getSceneryName().contains(pc.getProductName())){
//								inputProds.add(inputProd);
//							}
//						}else{
//							inputProds.add(inputProd);
//						}
					}
				}
				
			} else if (companyCode != null && "tc".equals(companyCode)) {
				for (LMMCareProduct cp:careProducts) {
					if (cp.getTc_url() != null && !"".equals(cp.getTc_url()) && !"".equals(cp.getTc_url().trim())) {
						InputProduct inputProd = new InputProduct();
						List<TCTicketProduct> tcProducts = tcProductService.selectByUrl(cp.getTc_url().split("\n")[0]);
						inputProd.setDetailUrl(cp.getTc_url().split("\n")[0]);
						if(tcProducts==null||tcProducts.size()==0){
							tcProducts=tcProductService.selectByName(cp.getTc_name());
						}
						if (tcProducts.size() > 0) {
							inputProd.setSceneryName(tcProducts.get(0).getSceneryName());
							inputProd.setId(tcProducts.get(0).getId());
							inputProd.setProductId(tcProducts.get(0).getProductId());
							inputProd.setSceneryAddr(tcProducts.get(0).getSceneryAddr());
							inputProd.setCompanyCode("tc");
							inputProd.setCityCode(tcProducts.get(0).getCityCode());
							for(City_Model city:citys){
								if(city.getCityId().equals(tcProducts.get(0).getCityCode())){
									inputProd.setCityName(city.getName());
								}
							}
							inputProd.setCreateTime(tcProducts.get(0).getNewGrabTime());
							inputProd.setLowestPrice(tcProducts.get(0).getLowestPrice());
							inputProd.setScore(tcProducts.get(0).getScore());
							inputProd.setSnapshotAddr(tcProducts.get(0).getSnapshotAddr());
							inputProd.setStarLevel(tcProducts.get(0).getStarLevel());
							inputProd.setTaskId(tcProducts.get(0).getTaskId());
							inputProd.setSaleCount(tcProducts.get(0).getSaleCount());
						}
						inputProds.add(inputProd);
//						if(pc.getProductId()!=null&&pc.getProductName()!=null){
//							if(inputProd.getProductId()!=null&&!"".equals(inputProd.getProductId().trim())&&
//									inputProd.getSceneryName()!=null&&!"".equals(inputProd.getSceneryName().trim())&&
//									inputProd.getProductId().contains(pc.getProductId())
//									&&inputProd.getSceneryName().contains(pc.getProductName())){
//								inputProds.add(inputProd);
//							}
//							
//						}else{
//							inputProds.add(inputProd);
//						}
					}
				}
				
			} else if (companyCode != null && "qnr".equals(companyCode)) {
				for (LMMCareProduct cp:careProducts) {
					if (cp.getQnr_name() != null && !"".equals(cp.getQnr_name())
							&& !"".equals(cp.getQnr_name().trim())) {
						InputProduct inputProd = new InputProduct();
						
						List<QNRTicketProduct> qnrProducts = qnrProductService
								.selectByName(cp.getQnr_name().split("\n")[0]);
						if(qnrProducts==null||qnrProducts.size()==0){
							qnrProducts=qnrProductService.selectByUrl(cp.getQnr_url());
						}
						inputProd.setSceneryName(cp.getQnr_name().split("\n")[0]);
						if (qnrProducts.size() > 0) {
							inputProd.setDetailUrl(qnrProducts.get(0).getDetailUrl());
							inputProd.setId(qnrProducts.get(0).getId());
							inputProd.setProductId(qnrProducts.get(0).getProductId());
							inputProd.setSceneryAddr(qnrProducts.get(0).getSceneryAddr());
							inputProd.setCompanyCode("qnr");
							inputProd.setCityCode(qnrProducts.get(0).getCityCode());
							for(City_Model city:citys){
								if(city.getCityId().equals(qnrProducts.get(0).getCityCode())){
									inputProd.setCityName(city.getName());
								}
							}
							inputProd.setCreateTime(qnrProducts.get(0).getCreateTime());
							inputProd.setLowestPrice(qnrProducts.get(0).getLowestPrice());
							inputProd.setScore(qnrProducts.get(0).getScore());
							inputProd.setSnapshotAddr(qnrProducts.get(0).getSnapshotAddr());
							inputProd.setStarLevel(qnrProducts.get(0).getStarLevel());
							inputProd.setTaskId(qnrProducts.get(0).getTaskId());
							inputProd.setSaleCount(qnrProducts.get(0).getSaleCount());
						}
						inputProds.add(inputProd);
//						if(pc.getProductId()!=null&&pc.getProductName()!=null){
//							if(inputProd.getProductId()!=null&&!"".equals(inputProd.getProductId().trim())&&
//									inputProd.getSceneryName()!=null&&!"".equals(inputProd.getSceneryName().trim())&&
//									inputProd.getProductId().contains(pc.getProductId())&&
//									inputProd.getSceneryName().contains(pc.getProductName())){
//								inputProds.add(inputProd);
//							}
//							
//						}else{
//							inputProds.add(inputProd);
//						}
					}
				}
				
			}else if (companyCode != null && "mt".equals(companyCode)) {
				for (LMMCareProduct cp:careProducts) {
					if (cp.getMt_name() != null && !"".equals(cp.getMt_name())
							&& !"".equals(cp.getMt_name().trim())) {
						InputProduct inputProd = new InputProduct();
						
						List<MTTicketProduct> mtProducts = mtProductService
								.selectByUrl(cp.getMt_url(),cp.getMt_url().split("\n")[0]);
						inputProd.setDetailUrl(cp.getMt_url().split("\n")[0]);
						
						if(mtProducts==null||mtProducts.size()==0){
							mtProducts=mtProductService.selectByName(cp.getMt_name());
							inputProd.setSceneryName(cp.getMt_name().split("\n")[0]);
						}
						if (mtProducts.size() > 0) {
							inputProd.setId(mtProducts.get(0).getId());
							inputProd.setProductId(mtProducts.get(0).getProductId());
							inputProd.setSceneryName(mtProducts.get(0).getSceneryName());
							inputProd.setSceneryAddr(mtProducts.get(0).getSceneryAddr());
							inputProd.setCompanyCode("mt");
							inputProd.setCityCode(mtProducts.get(0).getCityCode());
							for(City_Model city:citys){
								if(city.getCityId().equals(mtProducts.get(0).getCityCode())){
									inputProd.setCityName(city.getName());
								}
							}
							inputProd.setCreateTime(mtProducts.get(0).getCreateTime());
							inputProd.setLowestPrice(mtProducts.get(0).getLowestPrice());
							inputProd.setScore(mtProducts.get(0).getScore());
							inputProd.setSnapshotAddr(mtProducts.get(0).getSnapshotAddr());
							inputProd.setStarLevel(mtProducts.get(0).getStarLevel());
							inputProd.setTaskId(mtProducts.get(0).getTaskId());
//							inputProd.setSaleCount(mtProducts.get(0).getSaleCount());
						}
						inputProds.add(inputProd);
					}
				}
				
			}
			
		}else if("HOTEL".equals(businessCode)){
			for (LMMCareProduct cp:careProducts) {
				InputProduct inputProd = new InputProduct();
				List<HotelProductDetail> products= new ArrayList<HotelProductDetail>();
				if(companyCode == null || "xc".equals(companyCode)){
					if (cp.getXc_url() != null && !"".equals(cp.getXc_url()) && !"".equals(cp.getXc_url().trim())) {
						String url = cp.getXc_url().split("\n")[0];
						products = hotelProductService.findByCompanyUrl("XC_C_CODE", url);
						inputProd.setDetailUrl(url);
						
					}
				}else if("tn".equals(companyCode)){
					if (cp.getTn_url() != null && !"".equals(cp.getTn_url()) && !"".equals(cp.getTn_url().trim())) {
						String url = cp.getTn_url().split("\n")[0];
						products = hotelProductService.findByCompanyUrl("TN_C_CODE", url);
						inputProd.setDetailUrl(url);
					}
				}else if("tc".equals(companyCode)){
					if (cp.getTc_url() != null && !"".equals(cp.getTc_url()) && !"".equals(cp.getTc_url().trim())) {
						String url = cp.getTc_url().split("\n")[0];
						products = hotelProductService.findByCompanyUrl("TC_C_CODE", url);
						inputProd.setDetailUrl(url);
					}
				}else if("qnr".equals(companyCode)){
					if (cp.getQnr_url() != null && !"".equals(cp.getQnr_url()) && !"".equals(cp.getQnr_url().trim())) {
						String url = cp.getQnr_url().split("\n")[0];
						products = hotelProductService.findByCompanyUrl("QNR_C_CODE", url);
						inputProd.setDetailUrl(url);
					}
				}else if("el".equals(companyCode)){
					if (cp.getYl_url() != null && !"".equals(cp.getYl_url()) && !"".equals(cp.getYl_url().trim())) {
						String url = cp.getYl_url().split("\n")[0];
						products = hotelProductService.findByCompanyUrl("EL_C_CODE", url);
						inputProd.setDetailUrl(url);
					}
				}
				if (products.size() > 0) {
					inputProd.setSceneryName(products.get(0).getHotelName());
					inputProd.setId(products.get(0).getId());
					inputProd.setProductId(products.get(0).getProductId());
					inputProd.setSceneryAddr(products.get(0).getHotelAddr());
					inputProd.setCompanyCode(companyCode);
					inputProd.setCityCode(products.get(0).getCityCode());
					for(City_Model city:citys){
						if(city.getCityId().equals(products.get(0).getCityCode())){
							inputProd.setCityName(city.getName());
						}
					}
					inputProd.setCreateTime(products.get(0).getCreateTime());
					inputProd.setLowestPrice(products.get(0).getLowestPrice());
					inputProd.setScore(products.get(0).getScore());
					inputProd.setSnapshotAddr(products.get(0).getSnapshotAddr());
					inputProd.setStarLevel(products.get(0).getStarLevel());
					inputProd.setTaskId(products.get(0).getTaskId());
				}
				inputProds.add(inputProd);
//				if(pc.getProductId()!=null&&pc.getProductName()!=null){
//					if(inputProd.getProductId()!=null&&!"".equals(inputProd.getProductId().trim())&&
//							inputProd.getProductId().contains(pc.getProductId())&&
//							inputProd.getSceneryName()!=null&&!"".equals(inputProd.getSceneryName().trim())&&
//							inputProd.getSceneryName().contains(pc.getProductName())){
//						inputProds.add(inputProd);
//					}
//					
//				}else{
//					inputProds.add(inputProd);
//				}
			}
		}
		
//		int pageNum = pc.getPage();
//		int pageSize = pc.getPageSize();
//		int start = (pageNum - 1) * pageSize;
//		int end = pageNum * pageSize;
//		int dataCount = inputProds.size();
//		if (end > dataCount) {
//		     end = dataCount;
//		}
//        List<InputProduct>data1=inputProds.subList(start, end);
//		PageInfo<InputProduct> page = new PageInfo<InputProduct>(data1);
//		page.setPageNum(pageNum);
//        page.setPageSize(pageSize);
//        int startRow = (pageNum - 1) * pageSize + 1;//开始条数
//        page.setStartRow(startRow);
//        page.setEndRow(end);//结束条数
//        page.setFirstPage(1);
//        page.setPrePage(pageNum - 1);//上一页
//        page.setNextPage(pageNum + 1);//下一页
//        page.setTotal(dataCount);
//        page.setTotal(dataCount);
//        int add = dataCount % pageSize == 0 ? 0 : 1;
//        int sum = dataCount / pageSize + add;
//        page.setPages(sum);
//        page.setLastPage(sum);
		model.addAttribute("prodList", inputProds);
//		List<LMMCareProduct> careProducts = productService.getAllList(pc2);
		PageInfo<LMMCareProduct> page=new PageInfo<LMMCareProduct>(careProducts);
		model.addAttribute("page", page);
		model.addAttribute("LMMCareProductVO", pc);
		model.addAttribute("companyCode", companyCode);
		return "/datashow/inputProduct";
	}

	@RequestMapping(value = "/updateInputProduct", method = { RequestMethod.GET, RequestMethod.POST })
	@ResponseBody
	public Map<String, Object> updateInputProduct(String id,  String sceneryAddr,
			String companyCode, String cityCode, String lowestPrice, String score,
			String createTime, String taskId, String snapshotAddr, String cityName,
			String businessCode) {
		Map<String, Object> result = getResult();
		List<String> cityIds = cityService.queryIdByName(cityName);
		if (cityIds.size() != 1) {
			result.put("cityError", "请输入正确的城市名！");
		} else {
			if(businessCode==null||"".equals(businessCode)||"TICKET".equals(businessCode)){
				if (companyCode == null || "xc".equals(companyCode)) {
					XCTicketProduct xcProd = new XCTicketProduct();
					xcProd.setId(id);
					xcProd.setSceneryAddr(sceneryAddr);
					xcProd.setCityCode(cityIds.get(0));
					xcProd.setLowestPrice(lowestPrice);
					xcProd.setScore(score);
					SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
					try {
						xcProd.setCreateTime(sdf.parse(createTime));
					} catch (ParseException e) {
						e.printStackTrace();
					}
					xcProd.setTaskId(taskId);
					xcProd.setSnapshotAddr(snapshotAddr);
					xcProductService.updateByPrimaryKeySelective(xcProd);
				} else if (companyCode != null && "tn".equals(companyCode)) {
					TNTicketProduct tnProd = new TNTicketProduct();
					tnProd.setId(id);
					tnProd.setSceneryAddr(sceneryAddr);
					tnProd.setCityCode(cityIds.get(0));
					tnProd.setLowestPrice(lowestPrice);
					tnProd.setScore(score);
					SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
					try {
						tnProd.setCreateTime(sdf.parse(createTime));
					} catch (ParseException e) {
						e.printStackTrace();
					}
					tnProd.setTaskId(taskId);
					tnProd.setSnapshotAddr(snapshotAddr);
					tnProductService.updateByPrimaryKeySelective(tnProd);
				} else if (companyCode != null && "tc".equals(companyCode)) {
					TCTicketProduct tcProd = new TCTicketProduct();
					tcProd.setId(id);
					tcProd.setSceneryAddr(sceneryAddr);
					tcProd.setCityCode(cityIds.get(0));
					tcProd.setLowestPrice(lowestPrice);
					tcProd.setScore(score);
					SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
					try {
						tcProd.setNewGrabTime(sdf.parse(createTime));
					} catch (ParseException e) {
						e.printStackTrace();
					}
					tcProd.setTaskId(taskId);
					tcProd.setSnapshotAddr(snapshotAddr);
					tcProductService.updateByPrimaryKeySelective(tcProd);
				} else if (companyCode != null && "qnr".equals(companyCode)) {
					QNRTicketProduct qnrProd = new QNRTicketProduct();
					qnrProd.setId(id);
					qnrProd.setSceneryAddr(sceneryAddr);
					qnrProd.setCityCode(cityIds.get(0));
					qnrProd.setLowestPrice(lowestPrice);
					qnrProd.setScore(score);
					SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
					try {
						qnrProd.setCreateTime(sdf.parse(createTime));
					} catch (ParseException e) {
						e.printStackTrace();
					}
					qnrProd.setTaskId(taskId);
					qnrProd.setSnapshotAddr(snapshotAddr);
					qnrProductService.updateByPrimaryKeySelective(qnrProd);
				} else if (companyCode != null && "mt".equals(companyCode)) {
					MTTicketProduct mtProd = new MTTicketProduct();
					mtProd.setId(id);
					mtProd.setSceneryAddr(sceneryAddr);
					mtProd.setCityCode(cityIds.get(0));
					mtProd.setLowestPrice(lowestPrice);
					mtProd.setScore(score);
					SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
					try {
						mtProd.setCreateTime(sdf.parse(createTime));
					} catch (ParseException e) {
						e.printStackTrace();
					}
					mtProd.setTaskId(taskId);
					mtProd.setSnapshotAddr(snapshotAddr);
					mtProductService.updateByPrimaryKeySelective(mtProd);
				}
			}else if("HOTEL".equals(businessCode)){
				HotelProductDetail hotel=new HotelProductDetail();
				hotel.setId(id);
				hotel.setHotelAddr(sceneryAddr);
				hotel.setCityCode(cityIds.get(0));
				hotel.setLowestPrice(lowestPrice);
				hotel.setScore(score);
				SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
				try {
					hotel.setCreateTime(sdf.parse(createTime));
				} catch (ParseException e) {
					e.printStackTrace();
				}
				hotel.setTaskId(taskId);
				hotel.setSnapshotAddr(snapshotAddr);
				hotelProductService.update(hotel);
			}
			
		}

		return result;
	}

	@RequestMapping(value = "/deleteInputProduct", method = { RequestMethod.GET, RequestMethod.POST })
	@ResponseBody
	public void deleteCareProduct(String id, String companyCode) {

		if (companyCode != null && "xc".equals(companyCode)) {
			xcProductService.deleteByPrimaryKey(id);
		} else if (companyCode != null && "tn".equals(companyCode)) {
			tnProductService.deleteByPrimaryKey(id);
		} else if (companyCode != null && "tc".equals(companyCode)) {
			tcProductService.deleteByPrimaryKey(id);
		} else if (companyCode != null && "qnr".equals(companyCode)) {
			qnrProductService.deleteByPrimaryKey(id);
		}

	}

	public InputProduct getInputProd() {

		InputProduct prod = new InputProduct();

		return prod;
	}

	public Map<String, Object> getResult() {

		Map<String, Object> result = new HashMap<String, Object>();

		return result;
	}
}
